/*

* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Smart-Shop开源商城系统/ Java商城-首选电商平台系统 请务必保留此注释头信息
* |     开源地址: https://gitee.com/ningbo-qishan/gruul-mall
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     可正常分享和学习源码,未经授权 不可商用！
* |     商业版中台购买/开源版商业授权 联系技术客服
* |     官网:  https://www.73app.cn/
* ------------------------------------------------------------------------
* ------------------------------------------------------------------------
* |     Copyright (c) 2016-2999 宁波启山智软科技有限公司
* |     版权所有 ,侵权必究！
* ------------------------------------------------------------------------

*/
package com.medusa.gruul.order.api.model;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 生成订单失败消息体
 *
 * @author alan
 * @date 2019/10/6 14:08
 */
@Data
public class OrderFailMessage implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 使用的积分 积分可能为空，注意判断
     */
    private BigDecimal integration;

    /**
     * 优惠券 优惠券可能为空，注意判断
     */
    private Long couponId;

    /**
     * 商铺id
     */
    private String shopId;

    /**
     * 租户ID
     */
    private String tenantId;
    /**
     * 用户id
     */
    private String userId;

    public OrderFailMessage integralFail(Long couponId, String userId, String shopId, String tenantId) {
        OrderFailMessage failMessage=new OrderFailMessage();
        failMessage.setCouponId(couponId);
        failMessage.setUserId(userId);
        failMessage.setShopId(shopId);
        failMessage.setTenantId(tenantId);
        return failMessage;
    }

    public OrderFailMessage stockFail(Long couponId, BigDecimal integration, String userId, String shopId, String tenantId) {
        OrderFailMessage failMessage=new OrderFailMessage();
        failMessage.setCouponId(couponId);
        failMessage.setUserId(userId);
        failMessage.setShopId(shopId);
        failMessage.setTenantId(tenantId);
        failMessage.setIntegration(integration);
        return failMessage;
    }
}
